import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { OrderTypeVO, OrderTypeForm, OrderTypeQuery } from '@/api/wms/orderType/types';

/**
 * 查询仓储作业类别表列表
 * @param query
 * @returns {*}
 */

export const listOrderType = (query?: OrderTypeQuery): AxiosPromise<OrderTypeVO[]> => {
  return request({
    url: '/wms/orderType/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询仓储作业类别表详细
 * @param typeId
 */
export const getOrderType = (typeId: string | number): AxiosPromise<OrderTypeVO> => {
  return request({
    url: '/wms/orderType/' + typeId,
    method: 'get'
  });
};

/**
 * 新增仓储作业类别表
 * @param data
 */
export const addOrderType = (data: OrderTypeForm) => {
  return request({
    url: '/wms/orderType',
    method: 'post',
    data: data
  });
};

/**
 * 修改仓储作业类别表
 * @param data
 */
export const updateOrderType = (data: OrderTypeForm) => {
  return request({
    url: '/wms/orderType',
    method: 'put',
    data: data
  });
};

/**
 * 删除仓储作业类别表
 * @param typeId
 */
export const delOrderType = (typeId: string | number | Array<string | number>) => {
  return request({
    url: '/wms/orderType/' + typeId,
    method: 'delete'
  });
};
